package org.lizar.config.group;

import org.lizar.json.JSON;

/**
 * An entry of group config.
 * 
 * @see Group
 *
 */
public class Explain {
	private String group;
	
	private String code;
	
	private Object  value;
	
	private String desc;
	
	public String getFullCode(){
		return group+"."+code;
	}
	
	public static Explain to_explain(JSON e){
		if(e==null)return null;
		Explain expl=new Explain();
		expl.group=e.getStr("group");
		expl.code=e.getStr("code");
		expl.value=e.getStr("value");
		expl.desc=e.getStr("desc");
		return expl;
	}
	
	public String toString(){
		return value.toString();
	}

	public String getGroup() {
		return group;
	}

	public void setGroup(String group) {
		this.group = group;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Object getValue() {
		return value;
	}

	public void setValue(Object value) {
		this.value = value;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	
}
